package com.tom.architect.day19.simple1;

import com.tom.architect.day19.simple1.iterator.Iterator;
import com.tom.architect.day19.simple1.iterator.WXIterator;

// 微信用户系统-数组
public class WXUserSystem implements Aggregate<UserInfo> {
    private UserInfo[] userInfos;

    public WXUserSystem() {
        userInfos = new UserInfo[3];
        userInfos[0] = new UserInfo("Tom", "111", "11", "男");
        userInfos[1] = new UserInfo("Lily", "222", "12", "男");
        userInfos[2] = new UserInfo("Lucy", "333", "13", "女");
    }

    @Override
    public Iterator<UserInfo> iterator() {
        return new WXIterator(userInfos);
    }
}
